<?php

/*
 * This file is part of the wiklite package.
 * (c) 2008 Guillermo Rauch <rauchg@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * wlToolkit provides basic utility methods.
 *
 * @package    wiklite
 * @subpackage core
 * @author     Guillermo Rauch <rauchg@gmail.com>
 * @version    SVN: $Id: wlToolkit.class.php 6 2008-09-20 06:35:54Z rauchg $
 */

class wlToolkit
{
  
  /**
   * Checks if obj is an instance of wlError. If the argument is false, it considers it an error and viceversa
   *
   *
   */
  function isError($obj)
  {
    if(is_bool($obj)) return ! $obj;
    return is_a($obj, 'wlError');
  }
  
  
  /**
   * Improved stripslashes that can take array as an argument
   *
   *
   */
  function stripslashes($value)
  {
    return is_array($value) ? array_map(array('wlToolkit', 'stripslashes'), $value) : stripslashes($value);
  }
 
  
}